/* 
 * File:   clientplayer.cpp
 * Author: iezahel
 * 
 * Created on December 28, 2008, 6:24 PM
 */

#include "clientplayer.h"

ClientPlayer::ClientPlayer(short port, char* addr) : Player(port, addr) {
    
}

ClientPlayer::ClientPlayer(const ClientPlayer& orig) {
}

ClientPlayer::~ClientPlayer() {    
}

GAME_ERROR_CODES ClientPlayer::InitNetworkConnection() {
    IPaddress ip;
    if (SDLNet_ResolveHost(&ip, hostname, host_port)==-1) {
        printf("SDLNet_ResolveHost: %s\n", SDLNet_GetError());
        return GAME_ERROR_SDL_NET;
    }

    tcp_sock = SDLNet_TCP_Open(&ip); /* Connect to the server */
    if (!tcp_sock) {
        printf("SDLNet_TCP_Open: %s\n", SDLNet_GetError());
        return GAME_ERROR_SDL_NET;
    }

    return GAME_ERROR_NONE;
}

